<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<h:form>
<h:dataTable binding="#{projectList.dataTable}" value="#{projectList.allProjects}" var="project" headerClass="tableHeader" styleClass="dataTable" rowClasses="oddRow, evenRow" rendered="#{not currentUser.assignedToProject}">
	<h:column>
		<f:facet name="header">
			<h:outputText value="Grupa" />
		</f:facet>
		<h:outputText value="#{project.group.groupName}" rendered="#{not project.free}"/>
		<h:commandButton value="Zapisz" action="#{projectList.registerProject}" rendered="#{not currentUser.teacher and project.free}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Temat" />
		</f:facet>
		<h:outputText value="#{project.topic}" />
	</h:column>
	<h:column>
		<f:facet name="header">
			<h:outputText value="Opis" />
		</f:facet>
		<h:outputText value="#{project.description}" />
	</h:column>
</h:dataTable>

<h:panelGrid columns="2" columnClasses="labelText, normalText" rendered="#{not currentUser.teacher and currentUser.assignedToProject}">
	<h:outputText value="Twoj temat projektu: " />
	<h:outputText value="#{projectList.subject.topic}" />
</h:panelGrid>
 
</h:form>